﻿#ifndef PANELMEASURETHREAD_H
#define PANELMEASURETHREAD_H

#include <QtCore/QThread>
#include <QtCore/QList>
#include <QtCore/QVector>
#include <QtCore/QPoint>
#include <QtCore/QSemaphore>
#include "Sqlite.h"
class MainWindow;
class StageControl;
class PanelMeasureThread : public QThread
{
    Q_OBJECT
public:
    PanelMeasureThread(QObject *parent = Q_NULLPTR);
    void setMainWindow(MainWindow * win);
    void setStageControl(StageControl * stageControl);
signals:
    void PanelMeasureFinish();
public slots:
//    void stop();
//    void xMoveFinished();
//    void yMoveFinished();
//    void zMoveFinished();

private:
    MainWindow *m_win;
    StageControl *m_stageControl;

    QList<MeasureSpecInfo> measureSpecInfoList;

    QSemaphore m_xSemaphore;
    QSemaphore m_ySemaphore;
    QSemaphore m_zSemaphore;
    bool m_stop;
    void initSemaphore();
    bool waitGotoPos();
    void autoMeasure();
protected:
    void run();
};

#endif // PANELMEASURETHREAD_H
